//package org.fzu.ercha.wuta.Application;
//
//import android.app.Application;
//import android.app.Service;
//import android.content.ComponentName;
//import android.content.Intent;
//import android.content.ServiceConnection;
//import android.media.MediaPlayer;
//import android.os.IBinder;
//import android.widget.Toast;
//
//import org.fzu.ercha.wuta.Service.MainService;
//
///**
// * Created by ercha on 2017/1/26.
// */
//
//public class BeApplication extends Application implements ServiceConnection {
//    private MainService mMainService;
//
//    @Override
//    public void onCreate() {
//        super.onCreate();
//
//        startMainService();
//        bindMainService();
//    }
//
//    public void startMainService () {
//        Intent it = new Intent (this, MainService.class);
//        startService(it);
//    }
//
//    public void stopMainService () {
//        Intent it = new Intent(this, MainService.class);
//        stopService(it);
//    }
//
//    private void bindMainService () {
//        Intent it = new Intent (this, MainService.class);
//        this.bindService(it, this, Service.BIND_AUTO_CREATE);
//    }
//
//    private void unbindMainService () {
//        this.unbindService(this);
//    }
//
//    @Override
//    public void onServiceConnected(ComponentName name, IBinder service) {
//        if (service instanceof MainService.ServiceBinder) {
//            MainService.ServiceBinder binder = (MainService.ServiceBinder)service;
//            mMainService = binder.getService();
//            mMainService.registerServiceCallback(mPlayManager);
//        }
//    }
//
//    @Override
//    public void onServiceDisconnected(ComponentName name) {
//        Toast.makeText(this, "onServiceDisconnected name=" + name, Toast.LENGTH_LONG).show();
//    }
//}
